﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DuAnNH.Fd_class
{
    class Cls_Ban
    {
        public static DataTable ChonBan(int tt)
        {
            string str = "select * from Ban WHERE TinhTrang=" + tt;
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
        public static DataTable MA_Ban()
        {
            string str = "select * from Ban WHERE TinhTrang=0 OR TinhTrang=2";
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
        public static DataTable MAU_Ban()
        {
            string str = "select * from Ban WHERE TinhTrang=1 OR TinhTrang=2";
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
        public static DataTable MA_BanGoc()
        {
            string str = "select * from Ban WHERE TinhTrang=1 OR TinhTrang=3";
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
        public static DataTable MA_BanGhep()
        {
            string str = "select * from Ban WHERE TinhTrang=0 OR TinhTrang=4";
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
        public static DataTable MA_BanHuy()
        {
            string str = "select * from Ban WHERE TinhTrang=5 OR TinhTrang=2";
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
        public static DataTable MA_BDi()
        {
            string str = "select * from Ban WHERE TinhTrang=1 OR TinhTrang=6";
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
        //public static DataTable MA_BDen(string mbden)
        //{
        //    string str =string.Format( "select * from Ban WHERE TinhTrang=2 OR TinhTrang=5 AND GhepBan='{0}'",mbden);
        //    SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
        //    DataTable DT = new DataTable();
        //    sdap.Fill(DT);
        //    return DT;
        //}
        public static DataTable MA_BDen()
        {
            string str = string.Format("select * from Ban WHERE TinhTrang=0 OR TinhTrang=5");
            SqlDataAdapter sdap = new SqlDataAdapter(str, Coso.con);
            DataTable DT = new DataTable();
            sdap.Fill(DT);
            return DT;
        }
    }
}
